package com.vitae.serviceImpl.resumeServiceImpl;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.vitae.entity.Resume;
import com.vitae.mapper.ResumeReadDao;
import com.vitae.service.resumeService.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/5/16.
 */
@Service(value = "resumeServiceImpl")
public class ResumeServiceImpl implements ResumeService {
    @Autowired
    ResumeReadDao resumeReadDao;

    @Override
    public BaseMapper<Resume> baseMapper() {
        return this.resumeReadDao;
    }

    @Override
    public List<Resume> findResumeByUserId(Integer userId, int pageNo) {
        return resumeReadDao.selectPage(new Page<Resume>(pageNo,10),new EntityWrapper<Resume>().eq("user_id",userId));
    }
    @Override
    public Integer findResumeByUserIdCount(Integer userId) {
        return resumeReadDao.selectCount(new EntityWrapper<Resume>().eq("user_id",userId));
    }
}
